/******************************************************************************* 
 * Copyright (c) 2008 xored software, Inc.  
 * 
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Eclipse Public License v1.0 
 * which accompanies this distribution, and is available at 
 * http://www.eclipse.org/legal/epl-v10.html  
 * 
 * Contributors: 
 *     xored software, Inc. - initial API and Implementation (Yuri Strot) 
 *******************************************************************************/
package com.xored.glance.internal.st;

import org.eclipse.jface.viewers.StyledString.Styler;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.graphics.TextStyle;

/**
 * @author Yuri Strot
 * 
 */
public class FullStyler extends Styler {

	private StyleRange range;

	public FullStyler(StyleRange range) {
		this.range = range;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.jface.viewers.StyledString.Styler#applyStyles(org.eclipse
	 * .swt.graphics.TextStyle)
	 */
	@Override
	public void applyStyles(TextStyle textStyle) {
		textStyle.font = range.font;
		textStyle.foreground = range.foreground;
		textStyle.background = range.background;
		textStyle.underline = range.underline;
		textStyle.underlineColor = range.underlineColor;
		textStyle.underlineStyle = range.underlineStyle;
		textStyle.strikeout = range.strikeout;
		textStyle.strikeoutColor = range.strikeoutColor;
		textStyle.borderStyle = range.borderStyle;
		textStyle.borderColor = range.borderColor;
		textStyle.metrics = range.metrics;
		textStyle.rise = range.rise;
	}

}
